package com.willcode.demo.mvc.controller.web;

import com.willcode.demo.mvc.model.entity.TempUserInfo4Enum;
import com.willcode.demo.mvc.model.service.ITempUserInfoService4Enum;
import com.willcode.demo.mvc.view.model.Re;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Will
 */
@RestController
@RequestMapping(name = "MyBatis测试接口", value = "/springboot/tempuserinfo4enum")
public class TempUserInfo4EnumController {

    @Autowired
    private ITempUserInfoService4Enum tempUserInfoService;

    @RequestMapping(value = "insert")
    public Re insert(TempUserInfo4Enum tempUserInfo) {
        return new Re("200", "数据插入成功", tempUserInfoService.insert(tempUserInfo));
    }

    @RequestMapping(value = "deletebyid")
    public Re deleteById(String id) {
        return new Re("200", "数据删除成功", tempUserInfoService.deleteById(id));
    }

    @RequestMapping(value = "updatebyid")
    public Re updateById(TempUserInfo4Enum tempUserInfo) {
        return new Re("200", "数据更新成功", tempUserInfoService.updateById(tempUserInfo));
    }

    @RequestMapping(value = "selectbyid")
    public Re selectById(String id) {
        return new Re("200", "索引查找成功", tempUserInfoService.selectById(id));
    }

    @RequestMapping(value = "selectalltempuserinfo")
    public Re selectAllTempUserInfo() {
        return new Re("200", "全量查找成功", tempUserInfoService.selectAllTempUserInfo());
    }

}
